package cn.yuanqiao.archive.identification.service.impl;

import cn.yuanqiao.archive.identification.domain.IdentificationRecord;
import cn.yuanqiao.archive.identification.mapper.IdentificationRecordMapper;
import cn.yuanqiao.archive.identification.service.IIdentificationRecordService;
import cn.yuanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 识别记录Service业务层处理
 * 
 * @author xy
 * @date 2023-10-12
 */
@Service
public class IdentificationRecordServiceImpl implements IIdentificationRecordService
{
    @Autowired
    private IdentificationRecordMapper identificationRecordMapper;

    /**
     * 查询识别记录
     * 
     * @param id 识别记录主键
     * @return 识别记录
     */
    @Override
    public IdentificationRecord selectIdentificationRecordById(Long id)
    {
        return identificationRecordMapper.selectIdentificationRecordById(id,new IdentificationRecord().getTableName());
    }

    /**
     * 查询识别记录列表
     * 
     * @param identificationRecord 识别记录
     * @return 识别记录
     */
    @Override
    public List<IdentificationRecord> selectIdentificationRecordList(IdentificationRecord identificationRecord)
    {
        return identificationRecordMapper.selectIdentificationRecordList(identificationRecord);
    }

    /**
     * 新增识别记录
     * 
     * @param identificationRecord 识别记录
     * @return 结果
     */
    @Override
    public int insertIdentificationRecord(IdentificationRecord identificationRecord)
    {
        identificationRecord.setCreateTime(DateUtils.getNowDate());
        return identificationRecordMapper.insertIdentificationRecord(identificationRecord);
    }

    /**
     * 修改识别记录
     * 
     * @param identificationRecord 识别记录
     * @return 结果
     */
    @Override
    public int updateIdentificationRecord(IdentificationRecord identificationRecord)
    {
        return identificationRecordMapper.updateIdentificationRecord(identificationRecord);
    }

    /**
     * 批量删除识别记录
     * 
     * @param ids 需要删除的识别记录主键
     * @return 结果
     */
    @Override
    public int deleteIdentificationRecordByIds(Long[] ids)
    {
        return identificationRecordMapper.deleteIdentificationRecordByIds(ids,new IdentificationRecord().getTableName());
    }

    /**
     * 删除识别记录信息
     * 
     * @param id 识别记录主键
     * @return 结果
     */
    @Override
    public int deleteIdentificationRecordById(Long id)
    {
        return identificationRecordMapper.deleteIdentificationRecordById(id);
    }
}
